package com.ap.core.validation.message.rules;

import com.ap.core.message.managepayment.info.RetrieveRTPMessageInfo;
import com.ap.core.validation.message.info.MessageValidationInfo;
import com.ap.core.validation.message.info.RTPOriginalInfo;
import com.ap.core.validation.rules.AbstractValidationRule;
import org.joda.time.LocalDateTime;

/**
 * User: Dilip.Sridhar
 * Check for the reconciliation Cutoff End TimeStmp of the order payment record relating to the AP Transaction ID 
 * should be checked to ensure the RTP that it is stored on AP Core is within a valid reCon Cutoff End TimeStmp.
 */
public class TV0002Rule extends AbstractValidationRule<MessageValidationInfo<RetrieveRTPMessageInfo, RTPOriginalInfo>> {


    @Override
    public boolean validate(MessageValidationInfo<RetrieveRTPMessageInfo, RTPOriginalInfo> infoObject) {
    	/*boolean pass = true;
        if(new LocalDateTime().isAfter(infoObject.getOriginalInfo().getReconCutoffEndTime())){
        	pass = false;
        }*/
        return (!new LocalDateTime().isAfter(infoObject.getOriginalInfo().getReconCutoffEndTime()));
    }


}
